#include "stdafx.h"
#include "TempConnection.h"

#include "ServerConnection.h"

namespace ExamSystem
{

    CTempConnection::CTempConnection(CExamServerConnectionManager *manager, const StreamSocket& s)
        : TCPServerConnection(s)
        , m_connectionManager(manager)
    {

    }

    void CTempConnection::run(void)
    {
        m_connectionManager->ManageConnection(socket());
    }


    CTempConnectionFactory::CTempConnectionFactory(CExamServerConnectionManager *manager)
        : m_connectionManager(manager)
    {

    }

    TCPServerConnection* CTempConnectionFactory::createConnection(const StreamSocket& socket)
    {
        return new CTempConnection(m_connectionManager, socket);
    }

}